<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html>
<head>
<jsp:include page="/WEB-INF/pages/admin/public/meta.jsp"></jsp:include>
<title>添加类型</title>
</head>
<body>
	<div class="page-container">
		<form class="form form-horizontal" id="form-style-add" method="post" action="addStyle.action">
			<div class="row cl">
				<label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>类型名称：</label>
				<div class="formControls col-xs-8 col-sm-9">
					<input type="text" class="input-text" value="${style.name }" id="id_styleName" name="name" >
				</div>
			</div>
			<div class="row cl">
				<div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-2">
					<button onClick="article_save_submit();" class="btn btn-primary radius" type="button">
						<i class="Hui-iconfont">&#xe632;</i> 提交
					</button>
					<button onClick="layer_close();" class="btn btn-default radius" type="button">&nbsp;&nbsp;取消&nbsp;&nbsp;</button>
				</div>
			</div>
		</form>
	</div>


	<!--_footer 作为公共模版分离出去-->
	<script type="text/javascript" src="admin/lib/jquery/1.9.1/jquery.min.js"></script>
	<script type="text/javascript" src="admin/lib/layer/2.4/layer.js"></script>
	<script type="text/javascript" src="admin/static/h-ui/js/H-ui.min.js"></script>
	<script type="text/javascript" src="admin/static/h-ui.admin/js/H-ui.admin.js"></script>
	<!--/_footer /作为公共模版分离出去-->

	<!--请在下方写此页面业务相关的脚本-->
	
	<script type="text/javascript" src="admin/lib/jquery.validation/1.14.0/jquery.validate.js"></script> 
	<script type="text/javascript" src="admin/lib/jquery.validation/1.14.0/validate-methods.js"></script> 
	<script type="text/javascript" src="admin/lib/jquery.validation/1.14.0/messages_zh.js"></script> 
	<script type="text/javascript" src="admin/lib/webuploader/0.1.5/webuploader.min.js"></script>
	<script type="text/javascript">
		function article_save_submit() {
			var name = document.getElementById("id_styleName").value;
			if( name != null && name != '' ) {
				layer.confirm('确认要提交吗？',function(index){
					$("#form-style-add").ajaxSubmit({
						type: "POST",
						url: "addStyle.action",
					    success: function(){
					    	layer.msg('添加成功！',{icon: 1,time:1000});
							window.parent.location.reload();
					    },
					    error: function(){
					        layer.msg('提交失败！',{icon: 5,time:1000});
					    }
					});
				});
			}else{
				alert('名称不能为空');
			}
		}
		$(function() {
		  $( document ).tooltip();
		});
	</script>
</body>
</html>